package com.yzh.collection;

import java.util.ArrayList;
import java.util.List;

/**
 * @author : Bruce
 * @date: 2024/7/17 - 07 - 17 - 9:56
 * @Description: com.yzh.collection
 * @version: 1.0
 */
public class MyList {
    public static void main(String[] args) {
     /*
    List接口中常用方法：
    增加：add(int index, E element)
    删除：remove(int index)  remove(Object o)
    修改：set(int index, E element)
    查看：get(int index)
    判断：
    */

        List list = new ArrayList();
        list.add(1);
        list.add(2);
        list.add(3);
        list.add("aa");
        System.out.println(list);
        list.add(1, 66);
        System.out.println(list);
        list.remove("aa");
        System.out.println(list);
        list.remove(2);
        System.out.println(list);

        System.out.println(list.get(2));

    }
}
